
import os
from config.LoadConfig import get_config


# /home/admin
__system_conf = get_config("system")
root_path=__system_conf.get("root_path","") # 根目录
__simple_server_name =__system_conf.get("simple_server_name","") # 服务简易名称


def build_save_file_dir(data_type: str):
    """
    构建存储路径util
    data_type:数据类型，有日志类型 logs ||  数据类型 datas
    """
    # /home/admin/datas    /home/admin/logs
    base_dir=os.path.join(root_path,data_type)

    # 日志存储路径
    if data_type=="datas":
        # /home/admin/datas/ocr
        base_dir=f"{root_path}/datas/{__simple_server_name}"

    return base_dir
